﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Pot0a00
    {
        private int? _brandcode;
		private string _brandname;
        private DateTime? _createdate;
		private string _muser;
		private string _listid;
		private string _status;
		
        /// <summary>
        /// 品牌代码
        /// </summary>
		public int? Brandcode
		{
			get { return _brandcode;	 }
			set { _brandcode=value;	}
		}
        /// <summary>
        /// 品牌名称
        /// </summary>
		public string Brandname
		{
			get { return _brandname;	 }
			set { _brandname=value;	}
		}
        /// <summary>
        /// 创建日期
        /// </summary>
		public DateTime? Createdate
		{
			get { return _createdate;	 }
			set { _createdate=value;	}
		}
        /// <summary>
        /// 用户标识
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Status
		{
			get { return _status;	 }
			set { _status=value;	}
		}
		
		public static List<Pot0a00> GetPot0a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Pot0a00> list = new List<Pot0a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Pot0a00 model = GetPot0a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Pot0a00 GetPot0a00ByDataRow(DataRow dr)
		{
			Pot0a00 model = new Pot0a00(); //实例化Pot0a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("brandcode")&&!(dr["brandcode"] is System.DBNull))  
				model.Brandcode = ( int)dr["brandcode"];
			if (dcc.Contains("brandname")&&!(dr["brandname"] is System.DBNull))  
				model.Brandname = ( string)dr["brandname"];
			if (dcc.Contains("createdate")&&!(dr["createdate"] is System.DBNull))  
				model.Createdate = ( DateTime)dr["createdate"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("status")&&!(dr["status"] is System.DBNull))  
				model.Status = ( string)dr["status"];
			
			return model;
		}
    }
}
